<?php
include("connect.php");
try
{
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host='.$host.';dbname='.$base, $util, $password, $pdo_options);
if((isset ($_POST["login"])) && (isset ($_POST["pwd"])))
{
$reponse = $bdd->prepare("insert into utilisateurs(login,password) values(?,?);");
$reponse->execute(array($_POST["login"],$_POST["pwd"]));
if($reponse) 
{echo "compte enregistr&eacute - votre login est :".$_POST["login"];
}
else {header("location: authentification.html");}
}
}

catch (Exception $e)
{
    die('Erreur : ' . $e->getMessage());
}

?>